/**
 * ts 类: class
 * 
 */

 //例子 创建一个城市类

class City {
    // 属性
    cityName: string;
    level: number;

    // 构造函数
     constructor(cityName: string, level: number) {
         
         this.cityName = cityName;
         this.level = level
     }

    //方法
    about(pararms?:string):void {
        console.log(`欢迎来个${this.cityName},此地危险系数：${this.level}`);
        console.log(`about的参数:${pararms}`);
    }
 }


let c1 = new City("北京", 10);
console.log(c1.cityName);
c1.about();
c1.about("牙买跌");